package com.stock.demo.function.mine.presenter;

import com.stock.demo.function.mine.view.MineFragment;
import com.stock.demo.function.mine.view.MineView;
import com.stock.demo.util.SettingUtils;

/**
 * Created by XuZhaoyu on 2017/6/25.
 */

public class MinePresenterImpl implements MinePresenter {

    private MineView mMineView;

    public MinePresenterImpl(MineView mineView) {
        mMineView = mineView;
    }

    @Override
    public void setAutoLogin(boolean isAutoLogin) {
        SettingUtils.setAutoLogin(isAutoLogin);
    }

    @Override
    public void setForceRefresh(boolean isChecked) {
        SettingUtils.setForceRefresh(isChecked);
    }

    @Override
    public void logout() {
        if (mMineView instanceof MineFragment) {
            SettingUtils.setAutoLogin(false);
            mMineView.onLogout();
        }
    }
}
